package com.mocha.bass.test.jiangan;

import com.hyzh.latte.NezhaApplication;
import com.hyzh.latte.vehicle.dmo.entity.CameraPGEntity;
import com.hyzh.latte.vehicle.repository.CameraPGRepository;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author songkui
 * @since 2024/5/27 14:47
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = NezhaApplication.class)
@Slf4j
public class AddCamera {

    @Autowired
    private CameraPGRepository cameraPGRepository;

    @Test
    public void test(){

        CameraPGEntity pgEntity = new CameraPGEntity();
        pgEntity.setCameraCode("52038");
        pgEntity.setCameraName("192.168.11.38");
        pgEntity.setPoleCode("pole38");
        pgEntity.setParkCode("jiangan");
        pgEntity.setDirection(1);
        cameraPGRepository.save(pgEntity);

        pgEntity = new CameraPGEntity();
        pgEntity.setCameraCode("52039");
        pgEntity.setCameraName("192.168.11.39");
        pgEntity.setPoleCode("pole38");
        pgEntity.setParkCode("jiangan");
        pgEntity.setDirection(1);
        cameraPGRepository.save(pgEntity);


        pgEntity = new CameraPGEntity();
        pgEntity.setCameraCode("52040");
        pgEntity.setCameraName("192.168.11.40");
        pgEntity.setPoleCode("pole38");
        pgEntity.setParkCode("jiangan");
        pgEntity.setDirection(1);
        cameraPGRepository.save(pgEntity);

        pgEntity = new CameraPGEntity();
        pgEntity.setCameraCode("52041");
        pgEntity.setCameraName("192.168.11.41");
        pgEntity.setPoleCode("pole38");
        pgEntity.setParkCode("jiangan");
        pgEntity.setDirection(1);
        cameraPGRepository.save(pgEntity);

        pgEntity = new CameraPGEntity();
        pgEntity.setCameraCode("52042");
        pgEntity.setCameraName("192.168.11.42");
        pgEntity.setPoleCode("pole38");
        pgEntity.setParkCode("jiangan");
        pgEntity.setDirection(1);
        cameraPGRepository.save(pgEntity);

    }
}
